<?php

// Includes obligatorios
include ('./dbconfig.php');
include ('../Libraries/Tools/JLTools.class.php');

// Objeto JLTools
$jl = new JLTools();

if (isset($_GET['id']))
    $where = " WHERE int_id_sections_view = '" . $_GET['id'] . "'";

$SQL = "SELECT 
      tbl_adhesion.int_id_adhesion,
      tbl_adhesion.var_title_link,
      tbl_adhesion.var_link_pdfword,
      tbl_states.var_htmldesc
    FROM
      tbl_states
      INNER JOIN tbl_adhesion ON (tbl_states.int_id_state = tbl_adhesion.int_id_state)
    " . $where;
$campoId = "int_id_adhesion";

$jl->dataGridJSON($cnn, $SQL, $campoId, true);

// Cerrar la coneccion obligatorio
mysql_close($cnn);
